package com.wrx.club_management_backend.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class PicConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 映射 URL 访问路径到本地文件路径
        registry.addResourceHandler("/uploads/**")  // 这里是你希望用来访问文件的 Web 路径
                .addResourceLocations("file:C:\\Users\\23296\\Desktop\\club-system-front-end\\club_management_backend\\club_management_backend\\upload\\")  // 本地文件路径
                .setCachePeriod(0);  // 不缓存文件
    }
}
